package com.gang.music.system.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author gang
 * @since 2017-10-29
 */
@TableName("pt_play_record")
public class PlayRecord extends Model<PlayRecord> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Long id;
	@TableField("play_date")
	private Date playDate;
	@TableField("play_count")
	private Long playCount;


	public PlayRecord(Date playDate) {
		
		this.playDate = playDate;
		this.playCount = 1l;
	}

	public PlayRecord() {
		
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getPlayDate() {
		return playDate;
	}

	public void setPlayDate(Date playDate) {
		this.playDate = playDate;
	}
	
	public Long getPlayCount() {
		return playCount;
	}

	public void setPlayCount(Long playCount) {
		this.playCount = playCount;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "PtPlayRecord{" +
			"id=" + id +
			", playDate=" + playDate +
			"}";
	}

	public void increase() {
		
		this.playCount += 1;
	}
}
